DataTable Library Object
From version 7.2, Real-Time Designer has new built-in library types - DataRow and DataTable, which enable you to execute functions on DataTables. In version 7.3, the Copy DataTable, Delete All Rows, Import from XML, and Export to XML functions were added.
The business entities in this library are exposed under Business Entities > Library Types > General > DataTable and Business Entities > Library Types > General> DataRow.
The functions are exposed under Project > References > Library References > Direct.Shared > DataTable and Project > References > Library References > Direct.Shared > DataRow.
For more information about working with DataTable functions, see Using the DataTable Functions and Using the DataTable Functions with Excel and JSON.
To use these functions, create an instance of type DataTable. The following parameters display the number of columns and number of rows in the DataTable. To see the DataTable in the Monitor, select the DataTable tab.
Name |
Input Type |
Description |
---|---|---|
NoOfColumns | Number | The number of columns in the DataTable. |
NoOfrows | Number | The number of rows in the DataTable. |
DataTableName | Text | The DataTable name. This name will be used if you export the table to XML. |
The DataTable object does not support tables with merged cells.
DataRow
The DataRow library contains functions that can be used to prepare a row before adding it to the DataTable.

Sets the value in a cell in the DataRow to a Boolean value.
Parameter | Input | Description |
---|---|---|
ColumnName |
Text |
The name of the column in which to set the cell value. |
Value |
Boolean |
The Boolean value to which to set the cell. |
Returns
Returns a Boolean value of True if the cell value was set, else returns False.

Sets the value in a cell in the DataRow to a datetime value.
Parameter | Input | Description |
---|---|---|
ColumnName |
Text |
The name of the column in which to set the cell value. |
Value |
Boolean |
The datetime value to which to set the cell. |
Returns
Returns a Boolean value of True if the cell value was set, else returns False.

Sets the value in a cell in the DataRow to a decimal value.
Parameter | Input | Description |
---|---|---|
ColumnName |
Text |
The name of the column in which to set the cell value. |
Value |
Boolean |
The decimal value to which to set the cell. |
Returns
Returns a Boolean value of True if the cell value was set, else returns False.

Sets the value in a cell in the DataRow to a number value.
Parameter | Input | Description |
---|---|---|
ColumnName |
Text |
The name of the column in which to set the cell value. |
Value |
Boolean |
The number value to which to set the cell. |
Returns
Returns a Boolean value of True if the cell value was set, else returns False.

Sets the value in a cell in the DataRow to a text value.
Parameter | Input | Description |
---|---|---|
ColumnName |
Text |
The name of the column in which to set the cell value. |
Value |
Boolean |
The text value to which to set the cell. |
Returns
Returns a Boolean value of True if the cell value was set, else returns False.
DataTable

Adds a column to the DataTable.
Parameter | Input | Description |
---|---|---|
columnName |
Text |
The name of the column to add to the DataTable. The DataTable cannot contain two columns with the same name. If you specify a column name that already exists, the new column will not be added. If you do not specify a column name, a column will be added with a default column name that is incremented sequentially. For example, Column1, Column2, and so on. |
columnType |
Text |
The type of data to be stored in the column. The supported data types are Boolean, DateTime, Decimal, Number, and Text. |
Returns
Returns a Boolean value of True if the column was added, else returns False.

Adds a row to the DataTable. Before using this function, use the Get New DataRow function to get a DataRow object, and the functions under the DataRow library to set the values for each cell in the row.
Parameter | Input | Description |
---|---|---|
DataRow |
DataRow |
The DataRow object to add to the DataTable. |
Returns
Returns a Boolean value of True if the DataRow was added, else returns False.

Adds multiple rows to the DataTable. Before using this function, use the Get New DataRow function to get DataRow objects, and the functions under the DataRow library to set the values for each cell in the rows.
Parameter | Input | Description |
---|---|---|
DataRow |
List of DataRow |
A list of the DataRow objects to add to the DataTable. |
Returns
Returns a Boolean value of True if the DataRows were added, else returns False.

Copies the DataTable. To view the copied DataTable, create a new DataTable instance, and assign the copied DataTable to the new DataTable instance. This function does not use any parameters.
Returns
Returns the copied DataTable.

Deletes all the rows from the DataTable. This function does not use any parameters.
Returns
N/A

Deletes a column from the DataTable.
Parameter | Input | Description |
---|---|---|
columnName |
Text |
The name of the column to delete from the DataTable. |
Returns
Returns a Boolean value of True if the column was deleted, else returns False.

Deletes a row from the DataTable.
Parameter | Input | Description |
---|---|---|
RowNumber |
Number |
The number of the row to delete from the DataTable. The row numbering begins at 1. |
Returns
Returns a Boolean value of True if the row was deleted, else returns False.

Exports the DataTable to an XML file.
Parameter | Input | Description |
---|---|---|
Xml File Name |
Text |
The path to the XML file on the local drive. If the specified file does not exist, it will be created. |
Returns
Returns a Boolean value of True if the DataTable was successfully exported to the XML file, else returns False.

Filters the DataTable by specific columns. To view the filtered DataTable, create a new DataTable instance, and assign the filtered DataTable to the instance.
Parameter | Input | Description |
---|---|---|
Columns |
List of Text |
The names of the column by which to filter the DataTable. |
Returns
Returns the filtered DataTable.

Filters the DataTable by a specific expression. To view the filtered DataTable, create a new DataTable instance, and assign the filtered DataTable to the instance.
Parameter | Input | Description |
---|---|---|
filterExpression |
Text |
The logical expression by which to filter the DataTable. |
Returns
Returns the filtered DataTable.

Filters the DataTable by a specific text filter expression. To view the filtered DataTable, create a new DataTable instance, and assign the filtered DataTable to the instance.
Parameter | Input | Description |
---|---|---|
textfilterExpression |
Text |
The text expression by which to filter the DataTable. The expression must contain a column name, an operator, and a filter value. Use the AND/OR operator to add multiple filter expressions. Examples:
|
Returns
Returns the filtered DataTable.

Gets a DataRow object from the DataTable, and assigns it to the DataRow Business Entity object to create a DataRow object based on the column types present in the DataTable. To add a row to DataTable, use this function before you use Add Row function. This function does not use any parameters.
Returns
N/A

Get the value from a cell in the DataTable.
Parameter | Input | Description |
---|---|---|
ColumnName |
Text |
The name of the column from which to retrieve the cell value. |
RowNumber | Number | The number of the row from which to retrieve the cell value. The row numbering begins at 1. |
Returns
Returns the value from the cell as text.

Imports the DataTable from a specified XML file. This function supports only one level of nesting from XML.
Parameter | Input | Description |
---|---|---|
Xml File Name |
Text |
The path to the XML file on the local drive. The DataTable will inherit the schema from the XML file. |
Returns
Returns a Boolean value of True if the DataTable was successfully imported, else returns False.

Imports the DataTable from XML text present in the Text property. This function supports only one level of nesting from XML.
Parameter | Input | Description |
---|---|---|
XML Text |
Text |
The text property that contains the XML string. The DataTable will inherit the schema from the XML text. |
Returns
Returns a Boolean value of True if the DataTable was successfully imported, else returns False.

Finds the lookup value from the specified column and returns the looked up value from the specified target column. T oview the value, assign the function output to a DataTable Lookup Value object.
Parameter | Input | Description |
---|---|---|
lookUpValue |
Text |
The value to find in a column. |
lookUpColumnName | Text | The name of the column in which to find the lookup value. |
targetColumnName | Text | The name of the column in which to return the lookup value. |
Returns
Returns a List of DataTable Lookup Value objects.

Identifies and removes duplicate row from the DataTable. This function does not use any parameters.
Returns
N/A

Sets a Boolean value in a specified cell in the DataTable.
Parameter | Input | Description |
---|---|---|
ColumnName |
Text |
The name of the column in the DataTable that contains the cell. |
RowNumber | Number | The number of the row in the DataTable that contains the cell. The row numbering begins at 1. |
Value | Boolean | The Boolean value to set in the specified cell. |
Returns
Returns a Boolean value of True if the cell value was set, else returns False.

Sets a datetime value in a specified cell in the DataTable.
Parameter | Input | Description |
---|---|---|
ColumnName |
Text |
The name of the column in the DataTable that contains the cell. |
RowNumber | Number | The number of the row in the DataTable that contains the cell. The row numbering begins at 1. |
Value | Boolean | The datetime value to set in the specified cell. |
Returns
Returns a Boolean value of True if the cell value was set, else returns False.

Sets a decimal value in a specified cell in the DataTable.
Parameter | Input | Description |
---|---|---|
ColumnName |
Text |
The name of the column in the DataTable that contains the cell. |
RowNumber | Number | The number of the row in the DataTable that contains the cell. The row numbering begins at 1. |
Value | Boolean | The decimal value to set in the specified cell. |
Returns
Returns a Boolean value of True if the cell value was set, else returns False.

Sets a number value in a specified cell in the DataTable.
Parameter | Input | Description |
---|---|---|
ColumnName |
Text |
The name of the column in the DataTable that contains the cell. |
RowNumber | Number | The number of the row in the DataTable that contains the cell. The row numbering begins at 1. |
Value | Boolean | The number value to set in the specified cell. |
Returns
Returns a Boolean value of True if the cell value was set, else returns False.

Sets a text value in a specified cell in the DataTable.
Parameter | Input | Description |
---|---|---|
ColumnName |
Text |
The name of the column in the DataTable that contains the cell. |
RowNumber | Number | The number of the row in the DataTable that contains the cell. The row numbering begins at 1. |
Value | Boolean | The text value to set in the specified cell. |
Returns
Returns a Boolean value of True if the cell value was set, else returns False.

Sorts the DataTable by a specified column.
Parameter | Input | Description |
---|---|---|
ColumnName |
Text |
The name of the column by which to sort the DataTable. |
Order | Text | The sort order, either asc to sort in ascending order, or desc to sort in descending order. |
Returns
N/A